package com.hopital5.zhangyz.controller;

import com.hopital5.zhangyz.model.Label;
import com.hopital5.zhangyz.service.LabelService;
import com.hopital5.zhangyz.vo.request.LabelVoRequest;
import com.hopital5.zhangyz.vo.response.LabelVoResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/label")
public class LabelController extends BaseController {
    @Autowired
    LabelService labelService;

    @PutMapping
    public LabelVoResponse insert(@RequestBody LabelVoRequest labelVoRequest) {
        return LabelVoResponse.build(labelService.save(labelVoRequest));
    }

    @PostMapping
    public LabelVoResponse update(@RequestBody LabelVoRequest labelVoRequest) {
        return LabelVoResponse.build(labelService.update(labelVoRequest));
    }
}
